import java.util.Scanner;

public class text1 {
    public static int countSegments(String s) {
        int ret=0;
        for(int i=0;i<s.length();i++){
            if((i==0||s.charAt(i-1)==' ')&&s.charAt(i)!=' '){
                ret++;
            }
        }
        return ret;
    }

    public static void main(String[] args) {
        String str = new String();
        Scanner scanner = new Scanner(System.in);
        str = scanner.nextLine();
        int ret=countSegments(str);
        System.out.println(ret);
    }
}
